﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class login1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void pswTextBox_TextChanged(object sender, EventArgs e)
    {

    }
    protected void loginBtn_Click(object sender, EventArgs e)
    {
        string uname = Convert.ToString(this.usrNoTextBox.Text.Trim());
        string upass = Convert.ToString(this.pswTextBox.Text.Trim());
        opeartorman staff_login = new opeartorman();
        bool dr_staff = staff_login.login(uname, upass);
        if (dr_staff)
        {
            //url = "index.aspx?userid=" + tname.Text; 
            //Response.Redirect(url);
            Session["userid"] = usrNoTextBox.Text;
            Server.Transfer("index.aspx");
            //  Response.Write("<script>window.open('index.aspx?userid=" + tname.Text + "&type=user','_blank')</script>");
        }
        else
        {
            Response.Write("<script>alert('用户名或密码错误！')</script>");
        }   
    }
    protected void resetBtn_Click(object sender, EventArgs e)
    {
        this.usrNoTextBox.Text = "";
        this.pswTextBox.Text = "";
    }
    protected void usrNoTextBox_TextChanged(object sender, EventArgs e)
    {

    }
}
